package com.glorystone.ins.domain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * Created by wangwei on 2018/3/14.
 */
public @Data @NoArgsConstructor @AllArgsConstructor @Builder class DepositRecord {

    /**
     * db model
     */
    private Long tid;
    private Long creditId;
    private Long channelId;
    /**
     * //    1.缴纳保证金 2.补缴保证金 3.逾期扣款 4.退保扣款
     */
    private Integer type;
    /**
     * 操作内容
     */
    private String content;
    /**
     * 操作金额
     */
    private BigDecimal operateAmount;
    /**
     * 剩余金额
     */
    private BigDecimal lastAmount;
    /**
     * 备注
     */
    private String remark;
    private Long createBy;
    @JsonSerialize(using = CustomLocalDateTimeSerializer.class)
    private LocalDateTime createAt;




    public enum TypeEnum {

        // 1.缴纳保证金 2.补缴保证金 3.逾期扣款 4.退保扣款， 5.退回保证金 6.结算扣款
        PAY(1, "缴纳保证金"),
        SUPPLEMENT(2, "补缴保证金"),
        OVERDUE(3, "逾期扣款"),
        RETURN(4, "退保扣款"),
        RETURN_DEPOSIT(5, "退回保证金"),
        SETTLEMENT(6, "结算扣款");


        private int value;
        private String content;
        public int getValue() {
            return value;
        }
        public String getContent() {
            return content;
        }
        TypeEnum(int value, String content) {
            this.value = value;
            this.content = content;
        }
    }




}
